<template>
  <div class="xtx-tabs-panel" v-show="activeName===name">
    <slot/>
  </div>
</template>
<script>
import { inject } from 'vue'

export default {
  name: 'XtxTabsPanel',
  // $slot.default()默认插槽内容
  props: {
    // label是选项卡名字
    label: {
      type: String,
      default: ''
    },
    // name选项卡唯一标识
    name: {
      type: [String, Number],
      default: ''
    }
  },
  setup () {
    const activeName = inject('activeName')
    return { activeName }
  }
}
</script>

<style scoped>

</style>
